<style rel="stylesheet/scss" lang="scss" scoped>
    .m-hread {
        width: 100%;
        height: 250px;
        background: #F0F0F0;
        padding: 10px;
        .m-hread_step {
            width: 100%;
            display: flex;
            align-items: center;
            >span {
                color: #409EFF;
            }
        }
        .m-hread_s {
            width: 100%;
            display: flex;
            align-items: flex-start;
            .s_model-id {
                width: 100px;
                height: 100px;
                resize: none;
                font-size: 15px;
            }
        }
		.m-hread_btn{
			width: 100%;
			display: flex;
			margin-top: 20px;
			align-items: center;
		}
    }
</style>
<template>
    <div class="m-hread">
        <div class="m-hread_step">
            <el-button type="primary" size="mini">同步车型数据</el-button>
            <el-button type="primary" size="mini">同步车型数据</el-button>
            <span class="m-l-10">车型数据库同步时间</span>
        </div>
        <div class="m-hread_s m-t-10">
            <span>车型ID: </span>
            <textarea class="s_model-id m-l-10 m-r-10" placeholder="车型ID可以输入多行" @input="textareaInput" v-model="modelValue"></textarea>
            <span class="m-r-10">or</span>
           <!-- <template >
                <el-select  class="m-l-10" placeholder="请选择" v-model="bName">
                    <el-option >											
                    </el-option>
                </el-select>
            </template>
			<template >
				<el-select  class="m-l-10" placeholder="请选择" v-model="sName">
					<el-option >
					</el-option>
				</el-select>
			</template>-->
        </div>
		<div class="m-hread_btn">
			<el-button type="primary" size="mini">筛选</el-button>
			<el-button type="primary" size="mini">重置</el-button>
			<!--<el-button type="primary" size="mini">导出excel</el-button>-->
		</div>
    </div>
</template>
<script>
	export default {
		data() {
			return {
				bName: '',
				sName: '',
				modelValue: ''
			}
		},
		methods: {
			textareaInput() {
				let ids = []
				ids = this.getModelIds()
				console.log(ids)
			},
			getModelIds() {
				let texts = [];
				texts = this.modelValue.split("\n");
				for(var i = 0 ; i < texts.length; i++) {
					let id=0
					try {
						id = Number.parseInt(texts[i].trim());
					} catch (error) {}
					if(Number.isNaN(id)){
						texts.splice(i,1);
					}else{
						i++;
					}
				}
				return texts;
			}
		},
		
	}
</script>
